<?php
class LayoutForm extends CFormModel
{
    public $content;
    public $layoutFile;
    
    public function rules()
    {
        return array(
            array('content, layoutFile', 'required'),
        );
    }
    
    public function save()
    {
        file_put_contents($this->layoutFile, $this->content);
    }
    
    public function loadContent()
    {
        if (file_exists($this->layoutFile))
        {
            $this->content = file_get_contents($this->layoutFile);
        }
    }
}